www.gusucode.com > 地方成人教育中心整站源代码 1 > 地方成人教育中心整站源代码 1.0/xkjs.asp
<!--#include file="inc/conn.asp"--> <!--#include file="inc/sqlin.asp"--> <% Keyword=Trim(request.QueryString("Key")) CurrentSort=Trim(request.QueryString("SortID")) Sql="select * from Idea_News06 where IsShow="&GetState() if CurrentSort<>"" then if not IsNumeric(request.QueryString("SortID")) then Response.Write "<script>alert('参数错误!');history.go(-1);</script>" response.End() else SqlSort="select * from Idea_News06Sort where ID="&CurrentSort set rs=idea.exec(SqlSort,1) if not rs.eof then Title=rs("SortName") Sql=Sql+" and SortID="&Cint(CurrentSort)&"" else Response.Write "<script>alert('参数不在接收范围!');history.go(-1);</script>" response.End() end if rs.close set rs=nothing end if else Title="学科建设" end if if request.QueryString("Key")<>"" then Sql=Sql&" and NewsName like '%"&Keyword&"%'" end if Page = Trim(Request.QueryString("Page")) if Page = "" or Page < "1" then Page = "1" end if set rspage=idea.exec(Sql,1) if session("PageSize")="" or isnull(session("PageSize")) then session("PageSize")="6" end if rspage.pagesize=cint(session("PageSize")) Page = CInt(Page) if rspage.pagecount > "0" then rspage.absolutepage = Page end If IndexTemplateHtml=Replace(FSOFileRead("template/"&idea_3&"/html/xkjs.html"),"{template_head}",FSOFileRead("template/"&idea_3&"/html/head.html")) IndexTemplateHtml=Replace(IndexTemplateHtml,"{template_foot}",FSOFileRead("template/"&idea_3&"/html/foot.html")) IndexTemplateHtml=replace(IndexTemplateHtml,"images/","template/"&idea_3&"/images/") AllTemplateHtml=ReplaceGlobalLable(GetAllHtml_List(IndexTemplateHtml,Const_Rule,CurrentSort,Keyword,Page)) PageNumber_1=viewPage(rspage.recordcount,Page,4,session("PageLength"),rspage.pagecount,CurrentSort) GetAllHtml2=replace(AllTemplateHtml,"{idea_pagenumber}",PageNumber_1) GetAllHtml2=replace(GetAllHtml2,"{idea_title}",Title) response.write GetAllHtml2 rspage.close set rspage=nothing '-----------------------------显示分页----------------------------------- Function viewPage(AllRecordsCount,CurrentPage,BeforePages,ViewPageCount,AllPageNumber,CurrentSort) Str_PageList1=MakePageNumber(CurrentPage,BeforePages,ViewPageCount,AllPageNumber,"asp",CurrentSort) if CurrentPage=1 then FirstPagelink="首页" LastPagelink="上一页" else FirstPagelink="<a href=?SortID="&CurrentSort&">首页</a>" if CurrentPage=2 then LastPagelink="<a href=?SortID="&CurrentSort&">上一页</a>" else LastPagelink="<a href=?SortID="&CurrentSort&"&Page="&CurrentPage-1&">上一页</a>" end if end if if CurrentPage=AllPageNumber then NextPagelink="下一页" FinalPagelink="尾页" else NextPagelink="<a href=?SortID="&CurrentSort&"&Page="&CurrentPage+1&">下一页</a>" FinalPagelink="<a href=?SortID="&CurrentSort&"&Page="&AllPageNumber&">尾页</a>" end if Str_PageList2="页次:"&CurrentPage&"/"&AllPageNumber&"页 "&FirstPagelink&" "&LastPagelink&" "&Str_PageList1&" "&NextPagelink&" "&FinalPagelink&" 共"&AllRecordsCount&"条记录 " viewPage=Str_PageList2 End Function %>